<?php


namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Event;
use App\Events\TestEvent;
use App\Services\SendMessageService;
use App\Jobs\SendMsgJob;
use Illuminate\Support\Facades\Redis;
use App\Services\PostService;
use App\Models\User;
use App\Models\Post;
use App\Models\Comment;

class PostController extends Controller{

    public function index(){

        $res = Post::with(['user','comments','user.posts'])->first();
        //dd($res->user->nikoname);
        //dd($res->user->posts->count());
        dd($res->user->posts);
        dd($res->user->posts[0]->content);
        dd($res);
        
        $post_user = $res->user->id;
        dd($post_user);


        $post_comments = $res->comments;



        

    }


}